home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- palette_gc/--datasheet--
- palette_gc/--styleguide--
- palette_gc/PALETTE_GetClass
- palette_gc/--datasheet-- palette_gc/--datasheet--
-
- NAME
- palette_gc -- A colour selection gadget.
-
- SUPERCLASS
- gadgetclass
-
- REQUIRES
- bevel.image
-
- DESCRIPTION
- This gadget is equivalent to the GadTools PALETTE_KIND gadget, but
- implemented as a BOOPSI gadget class. It displays a palette of
- colours, allowing the user to select one.
-
- Advantages that this class provides:
-
- > Right mouse button cancels gadget action.
-
- > Supports window relativity.
-
- > Supports gadget interconnections.
-
- > Supports OS 3.0 BOOPSI Gadget HelpTest.
-
- METHODS
- OM_NEW -- Create the palette gadget, calls OM_SET. Passed to
- superclass.
-
- OM_SET -- Set object attributes. Passed to superclass first.
-
- OM_GET -- Get object attributes. Passed to superclass first.
-
- OM_NOTIFY -- Notify connections of attribute changes.
-
- OM_DISPOSE -- Frees resources and calls superclass.
-
- OM_UPDATE -- Calls OM_SET.
-
- GM_DOMAIN -- Return the maximum and minimum size of the gadget.
-
- GM_RENDER -- Renders the gadget imagry. Overrides the superclass.
-
- GM_KEYACTIVE -- Handles keyboard activation.
-
- GM_KEYINACTIVE -- Handles keyboard de-activation.
-
- GM_GOACTIVE -- Activate the gadget on mouse click only. Overrides
- the superclass.
-
- GM_HANDLEINPUT -- Handles input events once active. Overrides the
- superclass.
-
- GM_GOINACTIVE -- Deactivates the gadget. Passed to the superclass.
-
- All other methods are passed to the superclass.
-
- ATTRIBUTES
- GA_Disabled (BOOL)
- Set to TRUE to disable gadget, FALSE otherwise
-
- Defaults to FALSE.
-
- Applicability is (OM_NEW, OM_SET, OM_GET)
-
- PALETTE_Colour (UBYTE)
- Initially selected color of the palette. This number is a pen
- number, and not the ordinal color number within the palette
- gadget itself. The exception is when PALETTE_ColourTable is
- used, in which case you will get an index into your table.
-
- Defaults to 0.
-
- Applicability is (OM_NEW, OM_SET, OM_GET)
-
- PALETTE_ColourOffset (UBYTE)
- First color to use in screen palette.
-
- Defaults to 0.
-
- Applicability is (OM_NEW, OM_SET, OM_GET)
-
- PALETTE_ColourTable (UBYTE *)
- Pointer to a table of pen numbers indicating which colors
- should be used and edited by the palette gadget. This array
- must contain as many entries as there are colors displayed in
- the palette gadget PLUS the colour offset. The array provided
- with this tag must remain valid for the life of the gadget or
- until a new table is provided.
-
- Default is NULL, which causes a 1-to-1 mapping of pen numbers.
-
- Applicability is (OM_NEW, OM_SET, OM_GET)
-
- PALETTE_NumColours (UWORD)
- Number of colors to display in the palette gadget. Currently
- this MUST be a power of
-
- Defaults to 2.
-
- Applicability is (OM_NEW, OM_SET, OM_GET)
- palette_gc/--styleguide-- palette_gc/--styleguide--
-
- PALETTE STYLE
- The usability of a palette gadget decreases as the number of
- colours it is displaying increases. If there is a possibility
- that your palette gadget may be displaying a large number of
- colours (say, greater than 16), you should provide a means to
- simplify the colour selection. Two possibilities would be to
- divide your colour palette into banks, and have users switch
- banks via a chooser gadget for example. Another possibility
- would be to attach a scroller gadget to allow the user to
- scroll through the available colours, displaying just a
- subset of them on screen at a time. You may also want to sort
- your colours in some logical manner and use PALETTE_ColourTable.
- palette_gc/PALETTE_GetClass palette_gc/PALETTE_GetClass
-
- NAME
- PALETTE_GetClass -- Gets the pointer to the palette class.
-
- SYNOPSIS
- palette_class = PALETTE_GetClass();
- D0
-
- Class * PALETTE_GetClass(VOID);
-
- FUNCTION
- Obtains the pointer to the Palette gadget class for use with
- NewObject(). This function always returns a valid pointer so
- you do not need to check it. The reason is that if the library
- opens fine, then the pointer returned is already setup. (Of course
- this implies that if opening the library fails, you shouldn't be
- calling this.)
-
- Note that this function does not create the class, that is done
- when the class library is opened.
-
- INPUTS
- Nothing.
-
- RESULT
- palette_class - Pointer to the Palette gadget class.
-
- SEE ALSO
-